<?php
/**
 * Created by PhpStorm.
 * User: DongYao
 * Date: 2018/1/30
 * Time: 下午8:14
 */

namespace App\Exceptions;

use Exception;
use Throwable;
use Illuminate\Support\Facades\Log;

class OperationException extends Exception
{
    public $data;

    public function __construct($message = "", $data = array(), $code = 0, Throwable $previous = null)
    {
        parent::__construct($message, $code, $previous);

        $this->data = $data;
    }
    /**
     * 报告异常
     *
     * @return void
     */
    public function report()
    {
        Log::error($this->message, $this->data);
    }

    /**
     * 将异常渲染到 HTTP 响应中。
     *
     * @param  \Illuminate\Http\Request
     * @return void
     */
    public function render($request)
    {
    }
}